
const { ccclass, property } = cc._decorator;

@ccclass
export default class Blind extends cc.Component {



    @property
    time: number = 1;


    @property
    open: number = 1;
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}




    protected mat: any;

    start() {
        let sprite = this.node.getComponent(cc.Sprite)
        if (sprite) {
            this.mat = sprite.getMaterial(0)
        }
    }

    update(dt) {
        if (this.time == 0.0) {
            this.time = 1.0;
        } else {
            this.time = 0.0;
        }
        this.mat.setProperty("u_time", this.time)
        this.mat.setProperty("u_open", this.open)
    }


}
